import Vue from 'vue'
import Router from 'vue-router'
import Auth from '@/components/Auth'
import Home from '@/components/Home'
import Index from '@/components/Index'
import Edit from '@/components/Edit'
import Memory from '@/components/Memory'
import Album from '@/components/Album'
import Wish from '@/components/Wish'
import Privity from '@/components/Privity'
import NotFound from '@/components/NotFound'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: { path: '/home' }
    },
    {
      path: '/auth',
      redirect: { name: 'auth', params: { type: 'login' } }
    },
    {
      path: '/auth/:type',
      name: 'auth',
      component: Auth,
      props: true
    },
    {
      path: '/home',
      component: Home,
      children: [
        {
          path: '',
          name: 'index',
          component: Index
        },
        {
          path: 'edit',
          name: 'edit',
          component: Edit,
          alias: '/edit'
        },
        {
          path: 'memory',
          name: 'memory',
          component: Memory,
          alias: '/memory'
        },
        {
          path: 'album',
          name: 'album',
          component: Album,
          alias: '/album'
        },
        {
          path: 'wish',
          name: 'wish',
          component: Wish,
          alias: '/wish'
        },
        {
          path: 'privity',
          name: 'privity',
          component: Privity,
          alias: '/privity'
        },
        {
          path: '*',
          redirect: { name: 'notFound' }
        }
      ]
    },
    {
      path: '*',
      name: 'notFound',
      component: NotFound
    }
  ]
})
